{% extends "base_self.html" %}


{%block title%}后台管理页{%endblock%}
{%block script%}{{super()}}{%endblock%}
{%block banner%}{%endblock%}
{% block main %}


<p>{{username}},欢迎您</p>

<div class="uppostkind">

  <h2>上传博客文章</h2>
  <p>选择要上传的内容类型</p>
  <form class="" action="uppostkind" method="post">
    <ul class="contentype">
      {% if nav %}
        {% for key in nav %}
          {%if key != "自作小说"%}
            {% if nav.get(key)[0]%}
              <li class="havechild"><input type="radio" name="type" value="{{key}}">{{key}}
                <ul class='chichoice'>
                  {%for k in nav.get(key)%}
                    <li><input type="radio" name="label" value="{{k}}"> {{k}}</li>
                  {%endfor%}
                </ul>
              </li>
              {%else%}
              <li ><input type="radio" name="type" value="{{key}}">{{key}}</li>
            {%endif%}
          {%endif%}
        {%endfor%}
      {%else%}
      {%endif%}
    </ul>

    <script type="text/javascript">
  /*定义子菜单label的选中*/
      $(document).ready(function(){
        $("ul.contentype").children().click(function(){
          $(this).css({"color":"red"});
          $(this).siblings().css({"color":"black"});
          $(this).siblings().find("*").removeAttr("checked");
          if($(this).find("ul")){
            $(this).children().find("input:first").attr("checked",'checked')
          }
        })
      })
  /*定义子菜单label的显示与否*/
      $(document).ready(function(){
        $(".chichoice").hide();
        $("ul.contentype").children().click(function(){
          $(this).find("*").show();
          $(this).siblings().find("ul").hide();
          })
        })
    </script>
    <input type="submit" name="" value="提交">
  </form>
</div>


<div class="otheroption">
  <h2>其他操作</h2>

  <form class="" action="postmanage" method="get">
      <button type="submit" name="button">管理博客文章</button>
  </form>

  <button type="button" name="button"><a href="upnovel">添加新小说</a></button>

  <br>
  <br>
  <button type="button" name="button"><a href="choosenovel">更新旧文</a></button>


  <!--
  <form class="" action="upfake" method="get">
      <button type="submit" name="button">生成虚拟文章</button>
  </form>

  {%for message in get_flashed_messages()%}
  <div class="">
      {{message}}
  </div>
  {%endfor%}


  <form class="" action="upbook" method="get">
      <button type="submit" name="button">生成虚拟书籍</button>
  </form>

  {%for message in get_flashed_messages()%}
  <div class="">
      {{message}}
  </div>
  {%endfor%}

  <form class="" action="upgame" method="get">
      <button type="submit" name="button">生成虚拟游戏</button>
  </form>

  {%for message in get_flashed_messages()%}
  <div class="">
      {{message}}
  </div>
  {%endfor%}


  <a href="{{url_for('printdictnovellist',novel='负如来')}}">输出小说列表字典</a>
  <br>
  <br>

  <a href="{{url_for('paginate_test',page=1)}}">分页显示测试</a>
  <br>
  <br>

  <a href="querytest"> 查询返回结果类型测试</a>
  <br>
  <br>
  -->
</div>
{%endblock%}
